<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="common.jsp" %>
<%@ include file="GlobalVar.jsp" %>
<% request.setCharacterEncoding("utf-8");%>
<% response.setContentType("text/html;charset=utf-8");%>
<link href="CSS/style1.css" rel="stylesheet">
<body>
    <table width="100%"  border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td>
                <table width="750" height="768"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                    <tr>
                        <td valign="top">
                            <jsp:include page="banner.jsp"/>
                            <table width="100%" height="330"  border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td width="26%" valign="top">
                                        <jsp:include page="listbook.jsp"/>
                                    </td>
                                    <td width="5" valign="top" background="Images/Cen_separate.gif"></td>
                                    <td width="73%" valign="top"><table width="100%" height="272"  border="0" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td height="52" colspan="3" background="Images/index_10.gif">
                                                    <jsp:include page="search.jsp"/>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="73%" height="220" valign="top">



                                                    <table width="100%" height="55"  border="0" cellpadding="0" cellspacing="0">

                                                        <tr>
                                                            <td width="86%" height="100"  valign="top">
                                                                <table width="96%" height="34"  border="0" align="center" cellpadding="0" cellspacing="0" class="tableBorder_B">
                                                                    <tr bgcolor="#CCCCCC">
                                                                        <td width="6%" height="33" align="center">&nbsp;</td>
                                                                        <td width="38%" style="padding:5px;">书名</td>
                                                                        <td width="35%" style="padding:5px;">出版社</td>
                                                                        <td width="20%" style="padding:5px;">购    买</td>
                                                                    </tr>
                                                                </table>
                                                                <c:choose>
                                                                    <c:when test="${param.id!=null}">



                                                                        <jsp:setProperty name="book" property="id" value="${param.id}" />

                                                                        <c:forEach var="current" items="${book.dateByclass}">
                                                                            <table width="96%" height="21"  border="0" align="center" cellpadding="0" cellspacing="0" class="tableBorder_B">
                                                                                <tr>
                                                                                    <td width="6%" align="center"><img src="Images/greendot.gif" width="11" height="13"></td>
                                                                                    <td width="38%" style="padding:5px;"><a href="bookdetails.jsp?bookId=<c:out value="${current.bm}" escapeXml="false"></c:out>"><c:out value="${current.mc}" escapeXml="false"></c:out></a></td>
                                                                                    <td width="36%" style="padding:5px;"><c:out value="${current.publisher}" escapeXml="false"></c:out></td>
                                                                                    <td width="20%" style="padding:5px;">
                                                                                        <%if (session.getAttribute("UserName") != null) {%>
                                                                                        <input name="Submit5" type="submit" class="btn_grey" value="加入购物车" onClick="window.location.href='cartalog.jsp?Add=<c:out value="${current.bm}" escapeXml="false"></c:out>'">
                                                                                        <%} else {
            out.println("<a href=login.jsp>请先登录");
        }%></td>
                                                                                </tr>
                                                                            </table>
                                                                        </c:forEach>
                                                                    </c:when>
                                                                    <c:otherwise>
                                                                        <c:forEach var="current" items="${book.date}">
                                                                            <table width="96%" height="21"  border="0" align="center" cellpadding="0" cellspacing="0" class="tableBorder_B">
                                                                                <tr>
                                                                                    <td width="6%" align="center"><img src="Images/greendot.gif" width="11" height="13"></td>
                                                                                    <td width="38%" style="padding:5px;"><a href="bookdetails.jsp?bookId=<c:out value="${current.bm}" escapeXml="false"></c:out>"><c:out value="${current.mc}" escapeXml="false"></c:out></a></td>
                                                                                    <td width="36%" style="padding:5px;"><c:out value="${current.publisher}" escapeXml="false"></c:out></td>
                                                                                    <td width="20%" style="padding:5px;">
                                                                                        <%if (session.getAttribute("UserName") != null) {%>
                                                                                        <input name="Submit5" type="submit" class="btn_grey" value="加入购物车" onClick="window.location.href='cartalog.jsp?Add=<c:out value="${current.bm}" escapeXml="false"></c:out>'">
                                                                                        <%} else {
            out.println("<a href=login.jsp>请先登录");
        }%></td>
                                                                                </tr>
                                                                            </table>
                                                                        </c:forEach>
                                                                    </c:otherwise>
                                                                </c:choose>

                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                    <jsp:include page="copyright.jsp"/>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</body>
</html>
